{include file="common/header.tpl"}
<section class="main">
	<nav class="left-col">{include file="common/navi-education.tpl"}</nav>
    <article class="right-col">
   		<h2><a href="{$back}">Khóa học</a> &raquo; Cập nhật</h2>                    
        <form name="frmEdit" id="frmEdit" method="post" enctype="multipart/form-data" action="{$smarty.const.HOST_BACKEND}ecourse/saveedit" class="ui">
            <input type="hidden" name="pecoursid" id="pecoursid" value="{$row.ecoursid}" />
            <input type="hidden" name="pparentid" id="pparentid" value="{$row.parentid}" />
            <input type="hidden" name="pcontent" id="pcontent" value="" />
            <input type="hidden" name="ptbfeature" id="ptbfeature" value="" />           
            <ul>
            	{if isset($smarty.session.ECOURSE_ERROR)}
                    <li class="error">
                       {include file="common/error.tpl" dataSession=$smarty.session.ECOURSE_ERROR}    
                    </li>
                {/if}
                <li>
                    <label for="pcategoryid">Phân loại <span class="required">*</span>:</label>
                    <div class="sel">
                        <select id="pcategoryid" name="pcategoryid" onchange="javascript:loadEdu('pcategoryid','pprovince','peducateid');">
                            <option value="0">---Chọn--</option>
                            {foreach item=item from=$arrCategory}
                                    <option value="{$item.categoryid}" {if isset($smarty.session.ECOURSE_POST.pcategoryid) && $smarty.session.ECOURSE_POST.pcategoryid == $item.categoryid}selected="selected"{elseif $item.categoryid==$row.categoryid}selected="selected"{/if}>{$item.name}</option>
                                {/foreach}   
                        </select>
                    </div>
                </li>
                <li>
                    <label for="pprovince">Tỉnh/thành <span class="required">*</span>:</label>
                    <div class="sel">
                        <select id="pprovince" name="pprovince" onchange="javascript:loadEdu('pcategoryid','pprovince','peducateid');">
                            <option value="0">---Chọn--</option>
                            {if isset($smarty.session.ECOURSE_POST.pprovince)}
                                {html_options options=$arrProvince selected=$smarty.session.ECOURSE_POST.pprovince}
                            {else}
                                {html_options options=$arrProvince selected=$row.province}
                            {/if}
                        </select>
                    </div>
                </li>
                <li>
                    <label for="peducateid">Trường <span class="required">*</span>:</label>
                    <div class="sel">
                        <select id="peducateid" name="peducateid">
                            <option value="0">---Chọn--</option>
                            {if isset($smarty.session.ECOURSE_POST.educateid)}
                                {html_options options=$arrEducate selected=$smarty.session.ECOURSE_POST.educateid}
                            {else}
                                {html_options options=$arrEducate selected=$row.educateid}
                            {/if}
                        </select>
                    </div>
                </li>
                <li>
                    <label for="pname">Tên khóa học <span class="required">*</span>:</label>
                    <div class="txt">
                    	<input type="text" class="text" id="pname" name="pname" value="{if isset($smarty.session.ECOURSE_POST.pname)}{$smarty.session.ECOURSE_POST.pname|escape}{else}{$row.name}{/if}" maxlength="{$smarty.const.VL_NAME_MAXLENGTH}"/>
                    </div>
                </li>
                <li>
                    <label for="pstart">Bắt đầu:</label>
                    <div class="txt">
                    	<input type="text" class="text" id="pstart" name="pstart" value="{if isset($smarty.session.ECOURSE_POST.start)}{$smarty.session.ECOURSE_POST.start|escape}{else}{$row.start|date_format:"%d/%m/%Y"}{/if}" maxlength="10"/>
                    </div>
                </li>
                <li>
                    <label for="pprice">Học phí:</label>
                    <div class="txt">
                        <input type="text" class="text" id="pprice" name="pprice" value="{if isset($smarty.session.ECOURSE_POST.pprice)}{$smarty.session.ECOURSE_POST.pprice|escape}{else}{$row.price_s|number_format:0:'.':','}{if $row.price_e>0}-{$row.price_e|number_format:0:'.':','}{/if}{/if}" maxlength="50"/>
                        <p style="float:left;clear:both;padding-top:5px;color:#999999">Nếu học phí nằm trong khoảng thì cách nhau bằng dấu "-". Vd: 600-800</p>
                    </div>
                </li>
                <li>
                    <label for="punit">Đơn vị học phí:</label>
                    <div class="sel">
                        <select id="punit" name="punit">        
                            {if isset($smarty.session.ECOURSE_POST.punit)}                        	
                                {html_options options=$arrUnit selected=$smarty.session.ECOURSE_POST.punit}
                            {else}
                                {html_options options=$arrUnit selected=$row.unit}
                            {/if}
                    </select>
                    <div class="txt">
                </li> 
                <li>
                    <label for="pshort">Tóm lược:</label>
                    <div class="area">
                    	<textarea rows="0" cols="0" id="pshort" name="pshort">{if isset($smarty.session.ECOURSE_POST.pshort)}{$smarty.session.ECOURSE_POST.pshort|escape}{else}{$row.short|escape}{/if}</textarea>
                    </div>
                </li>                     
                <li>
                    <label for="fckcontent">Nội dung khóa học <span class="required">*</span>:</label>
                   	<div class="area">
                    	<textarea rows="1" cols="1" name="fckcontent" id="fckcontent">{if isset($smarty.session.ECOURSE_POST.pcontent)}{$smarty.session.ECOURSE_POST.pcontent}{else}{$row.content|escape}{/if}</textarea>
                    </div>
                </li>                
                <li>
                    <label for="ptag">Tag:</label>
                    <div class="txt">
                    	<input type="text" class="text" id="ptag" name="ptag" value="{if isset($smarty.session.ECOURSE_POST.ptag)}{$smarty.session.ECOURSE_POST.ptag|escape}{else}{$row.tag|escape}{/if}" maxlength="100"/>
                    </div>
                </li>     
                <li>
                	<label>Thông tin mở rộng:</label>
                    {include file="common/table-feature.tpl"}
                </li>                                           
                <li>
                    <button type="submit">Lưu dữ liệu</button>
                    <button type="button" onclick="document.location.href='{$back}'">Hủy</button>
                </li>
          	</ul>
        </form>    	
    </article>
</section>
{include file="common/footer.tpl"}
                
